/*
 * @Author: 谢陈洁
 * @Date: 2025-05-29 18:22:32
 * @LastEditors: 谢陈洁
 * @LastEditTime: 2025-08-04 10:05:04
 * @Description: file content
 */
// import { createApp } from 'vue'
import Particles from '@tsparticles/vue3'
// import { loadFull } from "tsparticles"; // if you are going to use `loadFull`, install the "tsparticles" package too.
import { loadSlim } from "@tsparticles/slim";
// if you are going to use `loadSlim`, install the "@tsparticles/slim" package too.

import App from './App.vue'
import router from './router'
import pinia from './stores'
import '@/assets/styles/reset.scss' // 引入全局样式

// import 'virtual:svg-icons-register' // 注册 SVG 图标
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
// import { loadFull } from 'tsparticles'
import 'element-plus/theme-chalk/dark/css-vars.css'
import type { Engine } from '@tsparticles/engine';
import { vPermission } from './directives/permission'
const app = createApp(App) // 创建 Vue 应用实例
// app.use(Particles, {
//   init: async (engine:any) => {
//     console.log('init', engine)
//     await loadFull(engine)
//   }
// })
app.use(Particles, {
  init: async (engine: Engine) => {
    // await loadFull(engine); // you can load the full tsParticles library from "tsparticles" if you need it
    await loadSlim(engine) // or you can load the slim version from "@tsparticles/slim" if don't need Shapes or Animations
  }
})

for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
  app.component(key, component)
}
app.use(pinia) // 挂载 Pinia 实例
app.use(router) // 挂载路由实例
app.directive('permission', vPermission)
app.mount('#app')
